package base.Day03;

import java.io.FileInputStream;
import java.io.IOException;

public class OperationDemo2
{
    public static void main(String[] args)
    {
        OperationDemo2 operationDemo02 = new OperationDemo2();
        operationDemo02.test();
        try
        {
            operationDemo02.fileInputStreamTest();
        }catch (IOException e)
        {
            e.printStackTrace();
        }
    }
    public void test()
    {
        int a = 100;
        int b =100;
        System.out.println(a++ > 100);
        System.out.println(++a > 101);
        System.out.println(++b > 101);
        System.out.println(++b >= 102);
    }


    public void fileInputStreamTest() throws IOException
    {
        String path = "src/news2.txt";
        FileInputStream fileInputStream = new FileInputStream(path);
        byte[] data = new byte[1024];
        int len = 0;
        while ((len = fileInputStream.read(data)) != -1)
        {
            System.out.println(new String(data,0,len));
        }
        fileInputStream.close();

    }





}
